package utils.ui.view;

import android.app.Dialog;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.ygk.bluepath.R;
import com.ygk.bluepath.core.BActivity;
import com.ygk.bluepath.core.BPresenter;


public class ProDialog_logo {

    private static Dialog cardDLG;

    public static void show(BActivity activity, boolean canCancel) {

        if (cardDLG == null) {
            cardDLG = new Dialog(activity, R.style.CustomProgressDialog);
            LinearLayout dioalog_choose_place = (LinearLayout) activity
                    .getLayoutInflater().inflate(
                            R.layout.custom_progress_dialog_logo, null);
            ImageView imageView = (ImageView) dioalog_choose_place
                    .findViewById(R.id.loadingImageView);
            ImageView imageView_show = (ImageView) dioalog_choose_place
                    .findViewById(R.id.iv_show);

            Jumper jumper = new Jumper(500, 30);

            jumper.attachToView(imageView, imageView_show);

            cardDLG.setCancelable(canCancel);

            cardDLG.setContentView(dioalog_choose_place);

            cardDLG.show();
        }

    }

    public static void close() {

        if (cardDLG != null) {
            cardDLG.dismiss();
            cardDLG = null;
        }

    }

}
